import type { SetStateAction } from 'react';
import { useState } from 'react';

const usePagination = () => {
  const [currentPage, setCurrentPage] = useState(1);
  const [pageSize, setPageSize] = useState(10);

  const handlePageChange = (page: SetStateAction<number>, size: SetStateAction<number>) => {
    setCurrentPage(page);
    setPageSize(size);
  };

  return { currentPage, pageSize, handlePageChange };
};

export default usePagination;
